import HYRequest from "../services/request"
import { BASE_URL, TIME_OUT } from "../services/config"
const hyRequest = new HYRequest({
    baseURL: BASE_URL,
    timeout: TIME_OUT
})
export const hyRequest2 = new HYRequest({
    baseURL: "http://codercba.com:1888/airbnb/api",
    timeout: TIME_OUT,
    interceptors: {
        requestSuccessFn: (config) => {
            console.log('爱彼迎请求成功的拦截');
            return config
        },
        requestFailureFn: (err) => {
            console.log('爱彼迎请求失败的拦截');
            return err
        },
        responseSuccessFn(res) {
            console.log('爱彼迎响应成功的拦截');
            return res
        },
        responseFailureFn(err) {
            console.log('爱彼迎响应失败的拦截');
            return err
        },
    }
})

export default hyRequest
